package site.marqstree.latte.ec.main.cart;

import site.marqstree.latte.ui.recycler.MultipleFields;
import site.marqstree.latte.ui.recycler.MultipleItemEntity;

/*
 * 项目名: EleCommerce
 * 包名: site.marqstree.latte.ec.main.cart
 * 文件名: ShopCartItemType
 * 创建者: marqstree
 * 创建时间: 2020/2/1 15:17
 * 描述: TODO
 */
public class ShopCartItemType {

    static final int SHOP_CART_ITEM = 6;

    static MultipleItemEntity clone(MultipleItemEntity oldEntity){
        final MultipleItemEntity newEntity = MultipleItemEntity.builder()
                .setField(MultipleFields.ITEM_TYPE, ShopCartItemType.SHOP_CART_ITEM)
                .setField(MultipleFields.ID, oldEntity.getField(MultipleFields.ID))
                .setField(MultipleFields.IMAGE_URL, oldEntity.getField(MultipleFields.IMAGE_URL))
                .setField(ShopCartItemFields.TITLE, oldEntity.getField(ShopCartItemFields.TITLE))
                .setField(ShopCartItemFields.DESC, oldEntity.getField(ShopCartItemFields.DESC))
                .setField(ShopCartItemFields.COUNT, oldEntity.getField(ShopCartItemFields.COUNT))
                .setField(ShopCartItemFields.PRICE, oldEntity.getField(ShopCartItemFields.PRICE))
                .setField(ShopCartItemFields.IS_SELECTED, oldEntity.getField(ShopCartItemFields.IS_SELECTED))
                .setField(ShopCartItemFields.POSITION, oldEntity.getField(ShopCartItemFields.POSITION))
                .build();
        return newEntity;
    }
}
